]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
js/ui: Subscribe touchpad gesture handlers to only touchpad events
authorDaniel van Vugt <daniel.van.vugt@canonical.com>
Fri, 10 Jan 2020 07:44:35 +0000 (15:44 +0800)
committerJonas Ådahl <jadahl@gmail.com>
Sat, 29 Feb 2020 13:39:17 +0000 (13:39 +0000)
The touchpad gesture handlers were receiving all events, all the time.
This meant that even mouse movements were getting translated into
JavaScript calls and then discarded by the handlers, which wasted CPU.

Now we subscribe the touchpad gesture handlers to only touchpad events.

Prequisite: https://gitlab.gnome.org/GNOME/mutter/merge_requests/1000

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/283
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/925

js/ui/swipeTracker.js
js/ui/viewSelector.js

index 77536e47666ac37d7bbf7fe65cb53356725493c2..818d101938c6fb09969b905c5f99eb2d7977fab7 100644 (file)
@@ -58,7 +58,7 @@ const TouchpadSwipeGesture = GObject.registerClass({
         this._orientation = Clutter.Orientation.VERTICAL;
         this._enabled = true;
 
-        global.stage.connect('captured-event', this._handleEvent.bind(this));
+        global.stage.connect('captured-event::touchpad', this._handleEvent.bind(this));
     }
 
     get enabled() {
index 8acea0c03df323b2bca9753e6cf27baa0d78ec7b..5c0dd9bb750fb0ebd215d54099560167f873cc2a 100644 (file)
@@ -44,7 +44,7 @@ function getTermsForSearchString(searchString) {
 
 var TouchpadShowOverviewAction = class {
     constructor(actor) {
-        actor.connect('captured-event', this._handleEvent.bind(this));
+        actor.connect('captured-event::touchpad', this._handleEvent.bind(this));
     }
 
     _handleEvent(actor, event) {